import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';

import nodejs from '@dfeidao/atom-web/msg/nodejs';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';

import hide from '@dfeidao/atom-web/ui/hide';
import get from '@dfeidao/atom-web/global/get';
import fire from '@dfeidao/atom-web/msg/fire';
import success from '@dfeidao/atom-web/msgbox/success';

export default async function a003(fd: IFeidaoAiBrowserComponent) {
const na001=get('na001');
 const arr=get('arr');
 const del=fd.data.node.querySelector<HTMLDivElement>('[data-id="delete"]');

	const res=await nodejs<{code: 0|1;result: string}>('question-bank/zj-000009/s001', {
		filter:{
			// 数组
			question_no:arr
				}
		 });
		 if (res.code === 1) {
			 success("删除成功");
			 set_node_cls(del,'display-n',true);
			 hide(fd.data.node);
			 if (na001 === 1) {
				 fire('zj-000001','a012');
			 } else {
				fire('zj-000001','a003');

			 }
		 }if (res.code === 0) {
			alert("删除失败");
		 }

}

